home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 27.zip
/
BS1 part 27
/
CandoV2.5_d1.adf
/
InstallCanDo
< prev
next >
Wrap
Text File
|
1993-10-07
|
15KB
|
571 lines
;*************************************************************************
; Title:
; Install-CanDo
;*************************************************************************
; Description:
; The Commodore Installer Script for CanDo 2.x Software
;*************************************************************************
; Author:
; Eddie Churchill, c/o INOVAtronics, Inc.
;*************************************************************************
; Still to do:
;*************************************************************************
; History:
; 22-Jul-1992
; Now copying the helpfiles and unsnapshotting the icons
; 25-Jun-1992
; Changed all around for 2.50
; 17:21:33 CST, 21 Jan 1992
; Added resident cando.library checking
; 11:55:39 CST, 20 Jan 1992
; Added DelOpt settings
; 13:44:22 CST, 15 Jan 1992
; Preserve old cando.info file if one exists
; 18:15:15 CST, 02 Jan 1992
; Made it actually ask for destination in novice mode
; 15:19:24 CST, 19 Dec 1991
; Updated for Installer 1.9
; 14:39:07 CST, 16 Dec 1991
; Finished
; 11:28:31 CST, 03 Dec 1991
; Rewritting script for Installer 1.7
;*************************************************************************
;******************************************************
;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
;******************************************************
; some useful variables
(set true 1)
(set false 0)
(set on true)
(set off false)
(set yes true)
(set no false)
(set yep yes)
(set nope no)
(set is_a_file 1)
(set is_a_dir 2)
(set quote "\"")
(set newline "\n")
(set nothing "")
(set testing nope)
; (set testing yep) ;<- uncomment this for testing mode
(set os2 (< 2293760 (getversion "exec.library" (resident)))) ; true if under 2.0
(set resident_candolib (getversion "cando.library" (resident)))
(set ntsc_mode false)
(set pal_mode true)
(set free-mem (+ (database "total-mem") 0)) ; leftover free ram
; set up our delete options
(delopts "AskUser" "OkNoDelete" "Force")
; determine the default system display mode
(if (= (database "vblank") "60")
(set display_mode ntsc_mode)
(set display_mode pal_mode)
)
; some useful procedures
; fills in the display_text string
(procedure get_display_text
(
(if (= display_mode ntsc_mode)
(set display_text "NTSC")
(set display_text "PAL")
)
)
)
; change userlevel to expert
(procedure expert_level
(
(user 2)
)
)
; change userlevel to novice
(procedure novice_level
(
(user 0)
)
)
; reset userlevel back to default
(procedure default_level
(
(user default-level)
)
)
; store off userlevel
(procedure save_default_level
(
(set default-level @user-level)
)
)
; some overused strings
(set omp (cat "One moment please..." newline))
(set pci "Patching the copied icons.")
; a general purpose global error trapper
(onerror
(makeassign "CanDoProgram_Master" (safe))
(makeassign "CanDoExtras_Master" (safe))
(makeassign "CanDoExamples_Master" (safe))
)
;****************************************
;***** FIGURE OUT WHERE STUFF GOES ******
;****************************************
; now figure out the initial defaults for a bunch of things
(if (= testing true)
( ; then clause
(set cando_dir "Ram:CanDo")
; (set cando_dir nothing)
; (set cando_dir (getassign "CanDo"))
)
( ; else clause
; @default-dest is already set for us
(set cando_dir (getassign "CanDo"))
)
)
; introduce our selfs to the viewers
(welcome "Welcome to the CanDo 2.5x installer. This installer uses "
"the Commodore Amiga Installer. All of our future new products "
"will be using this installer and we would love to get any feedback "
"that might help in improving the installation procedure." newline newline
)
; first reset the user level so that the novice can see whats going on
(save_default_level)
(expert_level)
; see if we are doing an update
(if (<> cando_dir nothing)
(if (askbool
(prompt "There seems to be a CanDo already installed in"
" your drawer named " quote cando_dir quote ". "
"Do you want the update installed over it?")
(help
"The installer has determined that you may already have a "
"copy of CanDo installed on your system. If this is wrong or "
"you want the update installed elsewhere, select NO as an "
"answer. Otherwise, select YES."
)
(default 1)
)
( ; the then clause
(set is_update true) ; hey, the user said yes
)
( ; the else clause
(set is_update false) ; hey, the user said nope
(set cando_dir
(askdir
(prompt "Where would you like CanDo installed?")
(help @askdir-help)
(default @default-dest)
(newpath)
)
)
)
)
)
; if cando_dir is still nothing then where do they want it?
(if (= cando_dir nothing)
(set cando_dir
(askdir
(prompt "Where would you like CanDo installed?")
(help @askdir-help)
(default @default-dest)
(newpath)
)
)
)
; before we go on lets reset the user's level back to what it was
(default_level)
; verify that the cando directory exists
(if (<> (exists cando_dir) is_a_dir)
(makedir cando_dir
(prompt
"The directory you have selected for CanDo does not "
"seem to exist. Do you want us to create it for you?"
)
(help @makedir-help)
(infos)
(confirm)
)
)
;***********************************
;***** GET FIRST DISK IN HERE ******
;***********************************
; ask for the first disk, it should be here but lets check anyway
(askdisk
(prompt "Please insert the disk labeled \"CanDo Program\".")
(help "The CanDo Program disk contains the main CanDo program"
"and some support programs and utilities"
)
(dest "CanDo")
(newname "CanDoProgram_Master")
)
; tell the user of our progress
(complete 5)
;************************************
;***** FIGURE OUT DISPLAY MODE ******
;************************************
; tell the user about it
(working omp "Checking to see what type of Display this system uses.")
; make sure the display_text is filled in
(get_display_text)
; ask the expert user what mode to use
(set display_mode
(askchoice
(prompt "You are currently using a " display_text " system. "
"Which display system do you want CanDo configured for?"
)
(help "This should be initially set to the correct display system "
"according to your Amiga. If you want, you can override this. "
"NTSC is normally only useful in the Americas (USA, Canada, "
" Mexico, etc.) whereas PAL is used everywhere else." newline
"All this really does is choose which basedeck CanDo should "
"default to. NTSC's basedeck's window is 320 by 200 and PAL's "
"is 320 by 256."
newline newline
@askchoice-help
)
(choices "NTSC Display (200/400 pixels high)" "PAL Display (256/512 pixels high)")
(default display_mode)
)
)
; figure out the correct text string
(get_display_text)
; tell the user of our progress
(complete 10)
(novice_level)
; first clean up the cando directory
(if (= (exists (tackon cando_dir "CanDoFiles")) is_a_dir)
(
(working omp "Cleaning up the CanDo directory.")
(set temp (cat "Cd " cando_dir "\nDelete (CanDoFiles|Helpfiles|ObjectTools|EditorTools|XtraTools|CLIUtilities) All Quiet"))
(run temp)
)
)
;****************************************
;***** COPY OVER FIRST DISK'S STUFF *****
;****************************************
; first copy over the c: stuff
(set c_dir
(copyfiles
(prompt "Copying C: files needed by CanDo")
(help "This will copy " quote "DeckRunner" quote " and " quote
"DeckBinder" quote " to your system's C directory." newline
newline
@copyfiles-help
)
(source "CanDoProgram_Master:C")
(dest "C:")
(pattern "Deck#?")
(files)
)
)
; look for c:deckrunner
(set deck_tool (tackon c_dir "DeckRunner"))
(if (<> (exists deck_tool) is_a_file)
(set deck_tool "DeckRunner")
)
; look for c:deckbinder
(set bind_tool (tackon c_dir "DeckBinder"))
(if (<> (exists bind_tool) is_a_file)
(set bind_tool "DeckBinder")
)
; tell the user of our progress
(complete 15)
; first copy over the libs: stuff
(working omp "Scanning to see which libraries are on this distribution disk.")
(copylib
(prompt "Copying/Updating CanDo.Library")
(source "CanDoProgram_Master:Libs/CanDo.Library")
(dest "Libs:")
)
(copylib
(prompt "Copying/Updating InovaMusic.Library")
(source "CanDoProgram_Master:Libs/InovaMusic.Library")
(dest "Libs:")
)
; tell the user of our progress
(complete 20)
(copylib
(prompt "Copying/Updating ASL.Library")
(source "CanDoProgram_Master:Libs/ASL.Library")
(dest "Libs:")
)
(copylib
(prompt "Copying/Updating AmigaGUIDE.Library")
(source "CanDoProgram_Master:Libs/AmigaGUIDE.Library")
(dest "Libs:")
)
; tell the user of our progress
(complete 25)
; preserving old cando info if it exists
(set temp (tackon cando_dir "CanDo.info"))
(if (= (exists temp) is_a_file)
(
(working omp "Preserving your old CanDo info file.")
(rename temp (tackon cando_dir "CanDo_Old.info"))
)
)
; Copy over the cando program itself
(working omp "Scanning for the CanDo program and readme files.")
(set cando_dir
(copyfiles
(prompt "Copying CanDo program and readme files")
(source "CanDoProgram_Master:CanDoStuff")
(dest cando_dir)
(pattern "#?")
(files)
(infos)
)
)
; tell the user of our progress
(complete 30)
; Copy over the cando program itself
(working omp "Copying CanDo's HelpFiles")
(set cando_dir
(copyfiles
(prompt "Copying CanDo's HelpFiles")
(source "CanDoProgram_Master:")
(dest cando_dir)
(pattern "HelpFiles")
(infos)
)
)
(set reader_tool "More")
; tell the user of our progress
(complete 35)
;************************************
;***** GET SECOND DISK IN HERE ******
;************************************
; ask for the second disk.
(askdisk
(prompt "Please insert the disk labeled \"CanDo Extras\".")
(help "The CanDo Extras disk contains various overlays and "
"support files for the CanDo program."
)
(dest "CanDoExtras")
(newname "CanDoExtras_Master")
)
; tell the user of our progress
(complete 50)
;*****************************************
;***** COPY OVER SECOND DISK'S STUFF *****
;*****************************************
; copy over cando's files and overlays
(working omp "Scanning for CanDo's data files and overlays.")
; due to a bug and because we want to still test we do this
(copyfiles
(prompt "Copying CanDo's Extras disk.")
(source "CanDoExtras_Master:CanDoStuff")
(dest cando_dir)
(pattern "#?")
(infos)
)
; tell the user of our progress
(complete 55)
; since the cando is setup for ntsc we only need to this for pal mode
(if (= display_mode pal_mode)
(
; make up the tempory directory name
(set temp_dir (tackon cando_dir "CanDoFiles/Overlays"))
; rename current (NTSC) base deck to basedeck.ntsc
(rename
(tackon temp_dir "BaseDeck")
(tackon temp_dir "BaseDeck.NTSC")
)
; rename basedeck.pal to basedeck
(rename
(tackon temp_dir "BaseDeck.PAL")
(tackon temp_dir "BaseDeck")
)
)
)
; tell the user of our progress
(complete 70)
;************************************
;***** GET THIRD DISK IN HERE ******
;************************************
; ask for the third disk.
(askdisk
(prompt "Please insert the disk labeled \"CanDo Examples and Utilities\".")
(help "The CanDo Examples and Utilities disk contains various utilities and "
"example decks for your use."
)
(dest "CanDoExamples")
(newname "CanDoExamples_Master")
)
; tell the user of our progress
(complete 75)
;****************************************
;***** COPY OVER THIRD DISK'S STUFF *****
;****************************************
; copy cando example disk's decks, cliutilities and utilities stuff
(working omp "Scanning for CanDo's utilities and example decks.")
; due to a bug and because we want to still test we do this
(copyfiles
(prompt "Copying CanDo's Examples disk.")
(source "CanDoExamples_Master:CanDoStuff")
(dest cando_dir)
(pattern "#?")
(infos)
)
; cleaning the icons in the directory
(working omp "Cleaning up the copied icons")
; here we go...
(foreach cando_dir "#?"
(
(set temp (tackon cando_dir @each-name))
(if (= (exists (cat temp ".info")) is_a_file)
(tooltype
(dest temp)
(noposition)
)
)
)
)
; modify S:User-Startup
(working omp "Updating S:User-Startup.")
(startup "CanDo"
(prompt
"Some instructions need to be added to the \"S:User-Startup\" "
"so that your system will be properly configured to use CanDo.")
(help @startup-help)
(command
"ASSIGN CanDo: " quote cando_dir quote newline
"ASSIGN CanDoExtras: " quote cando_dir quote newline
"ASSIGN CanDoExamples: " quote cando_dir quote newline
)
)
; tell the user of our progress
(complete 100)
;*****************************
;***** WE BE ALMOST DONE *****
;*****************************
; make sure that default-dir is pointing to the right place
(set @default-dest cando_dir)
; some debug stuff
(if testing
(
(debug (cat "cando_dir = " quote cando_dir quote))
(debug (cat "c_dir = " quote c_dir quote))
(debug (cat "libs_dir = " quote libs_dir quote))
(debug (cat "deck_tool = " quote deck_tool quote))
(debug (cat "bind_tool = " quote bind_tool quote))
(debug (cat "browse_tool = " quote browse_tool quote))
(debug (cat "killdeck_tool = " quote killdeck_tool quote))
(debug (cat "cando_tool = " quote cando_tool quote))
(debug (cat "reader_tool = " quote reader_tool quote))
(debug (cat "stuff_dir = " quote stuff_dir quote))
(debug (cat "mostuff_dir = " quote mostuff_dir quote))
(debug (cat "decks_dir = " quote decks_dir quote))
)
)
; unmake those three assignments
(makeassign "CanDoProgram_Master" (safe))
(makeassign "CanDoExtras_Master" (safe))
(makeassign "CanDoExamples_Master" (safe))
; final message for our viewers
; well either way we want to say this
(set end_text "Well thats it folks, have a fun time with CanDo v2.5x.") ; altspace in name
; if the system has a library loaded then ask user to reset their machine
(if (> resident_candolib 0)
(set end_text
(cat
"!! REBOOT YOUR MACHINE BEFORE USING CANDO !!"
newline
newline
"This machine has an old version of CanDo.library in memory. "
"In order to flush the library you should reboot your machine."
newline
newline
end_text
)
)
)
; now for the real exit
(exit end_text)